package com.kazares.persistencia;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author acazares Alejandro Cazares Diaz
 */
public class MySQLStdConn {

    private Connection conexion = null;

    public synchronized Connection getInstance() throws SQLException {
        if (conexion == null || conexion.isClosed()) {
            try{
                conexion = DriverManager.getConnection(
                    DbProperties.MYSQL_URL,
                    DbProperties.MYSQL_USER,
                    DbProperties.MYSQL_PASS);
            }catch(Exception e){
                System.err.println("Pequeño problema al conectar...");
            }
            
        }
        return conexion;
    }
    
    public static void main(String[] args) {
        
    }
}
